import { PipeTransform }  from '../nest/pipe-transform'
import { validate } from '../nest/class-validator'

export class Validate implements PipeTransform {
  transform(value: any, dto: any): any {
    const errors = validate(value, dto)

    if (errors.length > 0) {
      throw errors
    }
  }
}